﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Questionnaire.Models
{
    /// <summary>
    /// 问题
    /// </summary>
    [Table("tb_question")]
    public class Question
    {
        /// <summary>
        /// 标识
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; }
        /// <summary>
        /// 问卷标识
        /// </summary>
        [Display(Name = "问卷标识")]
        public long PaperId { get; set; }
        /// <summary>
        /// 题干
        /// </summary>
        [Display(Name = "题干")]
        public string Topic { get; set; }
        /// <summary>
        /// 选项类型
        /// </summary>
        [Display(Name = "选项类型")]
        public SelectionType SelectionType { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Display(Name = "排序")]
        public int Sort { get; set; }
    }

    /// <summary>
    /// 选项类型
    /// </summary>
    public enum SelectionType
    {
        /// <summary>
        /// 单选
        /// </summary>
        SingleSelection = 1,
        /// <summary>
        /// 多选
        /// </summary>
        MultipleSelection
    }
}
